﻿using Fozzy.Being;

using System.Linq;
using System.Collections.Generic;

namespace Fozzy.Family
{
    /// <summary>
    /// One family group. 
    /// </summary>
    public class Families                                           : Enumeration<Family> //, IExportable
    {
        #region States
        #endregion

        #region Properties
            public IEnumerable<Parents>                     Parents                 { get { return Instances.Select(fam => fam.Parents)         ; } }
        #endregion

        #region Birth-Death
        #endregion

        #region Constructeur
            public Families(Fozzy.File file)                        : base(file)
            { }
            public Families(IEnumerable<Family> families)           : base(families)
            { }
        #endregion

            public void Set(Parents parents)
            {
                foreach (Family family in Instances) if(family.Parents.Be(parents)) Set(family) ;
            }

            public void Set(Person person)
            {
                ///Argh : Comment on Set une Personne sans avoir la Multi-Sélection ???
            }

            //public void Save(File file)
            //{
            //    new Fozzy.Gedcom.File(file, Instances)              ;
            //}
    }
}
